import request from '@/utils/request'

// 查询品牌列表
export function listBrand(data) {
    return request({
        url: '/system/brand/list',
        method: 'get',
        params: data
    })
}

// 获取品牌详细信息
export function detailBrand(id) {
    return request({
        url: '/system/brand/getInfo?id=' + id,
        method: 'get'
    })
}

// 新建品牌
export function addBrand(data) {
    return request({
        url: '/system/brand/add',
        method: 'post',
        data: data
    })
}

// 编辑品牌
export function editBrand(data) {
    return request({
        url: '/system/brand/edit',
        method: 'post',
        data: data
    })
}

// 删除
export function deleteBrand(id) {
    return request({
        url: '/system/brand/delete?id=' + id,
        method: 'get'
    })
}

// 启用/禁用
export function enableBrand(id, status) {
    const data = {
        id,
        status
    }
    return request({
        url: '/system/brand/enable',
        method: 'post',
        data: data
    })
}